package com.hioove.core.model.base.config;

import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

/**
 * 配置类实例化对象
 */
public class ConfigInstance {

    // 配置信息的 实例化对象 k-v k:是配置类的注解 eg Bean.class Aspect.class Filter.calss
    private Map<Class<? extends Annotation>, Object> annotationInstance;

    public Map<Class<? extends Annotation>, Object> getAnnotationInstance() {
        return annotationInstance;
    }

    public void addAnnotationInstance(Class<? extends Annotation> annotation, Object configInstanceObj) {
        this.annotationInstance = Optional.ofNullable(annotationInstance).orElse(new HashMap<Class<? extends Annotation>, Object>());
        this.annotationInstance.put(annotation, configInstanceObj);
    }
}
